import { Transform, Type } from 'class-transformer'
import { UserSerialize } from './user.serialize'

export class PaginateSerialize {
  total: number

  @Transform(({ value }) => Number(value))
  pageNum: number

  @Transform(({ value }) => Number(value))
  pageSize: number

  @Type(() => UserSerialize)
  list: any[]

  constructor(partial: Partial<PaginateSerialize>) {
    Object.assign(this, partial)
  }
}
